<%//@ include file="../include/eproAuthorization.jsp"%>
<%@ page 
		contentType ="text/html; charset=windows-874" 
		import="java.util.Vector,
						com.epro.standard.usermenu.manage.*,
						com.epro.standard.usermenu.*,
						com.epro.standard.frontend.util.*,
						com.epro.standard.frontend.lov.*,
            com.softplus.carrefour.hd.CFHDSystem,
            com.softplus.carrefour.hd.bltier.admin.CountryManage,
            com.softplus.carrefour.hd.bltier.entity.Country,
						java.util.StringTokenizer	
            "
%>
<HTML xmlns:epro>
	<%@ taglib uri="/WEB-INF/HeadTag.tld"  prefix="header"%>
	<%@ taglib uri="/WEB-INF/LovTag.tld"   prefix="lov"%>
	<header:Head 
		author		  = "Max"
		title    		= "Time Zone Setup List Of Value (select country)"
		import    	= "lov"
		jsFile			= "../script/imgProp.js,../script/lov.js"
		styleFile 	= "../theme/LovTheme.css"	></header:Head>
<%
// Create datavector & Keywords.
	EproServletUtil servletUtil = new EproServletUtil(request) ;
// define variable **************************
	String size = request.getParameter("size") == null ? "m" : request.getParameter("size");
	
//  Create Manager
  
  CountryManage dataManager = (CountryManage)CFHDSystem.getControlClass("COUNTRY") ;
  LOVKeyword keyword = new LOVKeyword();
	//	Get search keyword.
	String searchKeyword = servletUtil.getRequestValue("searchKeyword") ;
	String cNames[] 			= servletUtil.getRequestValues("searchColumnName") ;
	
	Vector checkBoxVec = new Vector();
	keyword.setMessage(searchKeyword);
	if(cNames != null)
		for(int i = 0 ; i < cNames.length ; i++)
			checkBoxVec.add(com.epro.standard.frontend.util.StringUtil.stringTokenToArray(cNames[i])[0]) ;
	keyword.setCheckBox(checkBoxVec);

	// 1. Create LOV Object.
//	EproLOV lov = new EproLOV() ;
      com.epro.standard.frontend.lov.EproLOV lov = new com.epro.standard.frontend.lov.EproLOV() ;
	// 2. Adding columns.
	//EproLOVColumn(String label, String justify, Integer width, boolean isDisplay) ;
	lov.addColumn(new EproLOVColumn("Country ID", "left", 80, true)) ;
	lov.addColumn(new EproLOVColumn("Country Name", "left", 200, true)) ;

// *********change to check not exist in LOV case selection continueing*******noom 	
	String selectedID 		= servletUtil.getRequestValue("selectedID")== null ? "''" : servletUtil.getRequestValue("selectedID") ;

//***************************************************************************************
  if (!(selectedID.equals("")))
  {
    java.util.HashMap conds = new java.util.HashMap();
    conds.put("countryIDs", selectedID);
    keyword.setCondition(conds);
  }
	lov.addRow(dataManager.getLOVcountry(keyword)) ;
	
/*	
// *********change to check not exist in LOV case selection continueing*******max 
	Vector dataVector 	= new Vector() ;
	Vector newLov 			= new Vector() ;
	String selectedID 		= servletUtil.getRequestValue("selectedID") ;
	dataVector 					= dataManager.getLOVMenu(keyword) ;
	for ( int i = 0 ; i < dataVector.size() ; i++ )   
	{
		EproLOVRow rows = (EproLOVRow)dataVector.elementAt(i) ;
		Vector resultSet = rows.getLOVRow() ;
		if (selectedID.indexOf(resultSet.elementAt(0).toString()) == -1)
			newLov.addElement(rows) ;
	}
	lov.addRow(newLov) ;//lov.addRow(dataManager.getLOVnotExistInServiceAccess(keyword,"Y",false));
// *********
*/
//	data size default
	int	vectorSize = 0 ;
	vectorSize = lov.getBodyRows().size();

	boolean isMultiple = request.getParameter("isMultiple") != null ? request.getParameter("isMultiple").equalsIgnoreCase("true") : false ;
//  boolean isMultiple =true;
%>
<lov:lov lovObj="<%=lov%>" reqObj="<%=request%>" isMultiple="true"></lov:lov>
